/**
 * ship-device edit
 */
let _this;
let _loading;
let shipId = "";shipName="";
layui.use(['form', 'tableSelect', 'layedit', 'laydate'], function () {
    let form,layer,tableSelect,layedit,laydate,$;
    form = layui.form,
        layer = layui.layer,
        tableSelect = layui.tableSelect,
        layedit = layui.layedit,
        laydate = layui.laydate,
        $ = layui.$;

    let u = localStorage.getItem("ADMIN_LOGIN");
    let loginU = {};
    if (u == undefined) {
        layer.msg('请登录', {icon: 1, time: 500}, function () {
            window.location = 'page/login.html';
        });
    } else {
        loginU = decryptLocalStorage(u);
    }
    // if(loginU.shipId!=0){
    //     shipId=loginU.shipId
    // }
    let _url = localStorage.getItem("url");
    console.log("_url:"+_url);
    if (_url != undefined && _url!=null) {
        let url = decryptLocalStorage(_url, loginU.token);
        console.log("url:"+url);
        url="http://220.161.87.62:8800/hls/0/index.m3u8";
        let video = document.getElementById('video');
        let hls = new Hls();
        hls.loadSource(url);
        hls.attachMedia(video);
        hls.on(Hls.Events.MANIFEST_PARSED, function() {
            video.play();
        });
    }

});
